//
//  MovieCollectionViewController.m
//  豆瓣
//
//  Created by Roach on 16/6/25.
//  Copyright © 2016年 lanou. All rights reserved.
//

#import "MovieCollectionViewController.h"
#import "MovieModel.h"

@interface MovieCollectionViewController ()

@property (nonatomic, retain) NSMutableArray *modelArray;

@end

@implementation MovieCollectionViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
}

- (void)config {
    
    self.view.backgroundColor = [UIColor whiteColor];
}

- (void)values {
    NSString *path = [[NSBundle mainBundle]pathForResource:@"movielist" ofType:@"txt"];
    NSData *data = [NSData dataWithContentsOfFile:path];
    
    NSError *error = nil;
    NSDictionary *dictionary = [NSJSONSerialization JSONObjectWithData:data options:0 error:&error];
    NSArray *resultArray = [dictionary objectForKey:@"result"];
    for (NSDictionary *dic in resultArray) {
        
        MovieModel *model = [[MovieModel alloc]init];
        [model setValuesForKeysWithDictionary:dic];
        [self.modelArray addObject:model];
        [model release];
    }
    
}

- (void)creat {
    
    
    
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end